﻿using AFanDa.Dto.Base;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AFanDa.BLL.BLLService
{
    public class ResultService
    {
        public ApiResult GetResult(ApiCode code = ApiCode.ok, string message = "", object data = null)
        {
            if (string.IsNullOrEmpty(message))
            {
                message = code == ApiCode.ok ? "操作成功" : "操作失败";
            }

            return new ApiResult()
            {
                code = code,
                message = message,
                data = data
            };

        }
    }
}
